<template>
    <div>
        <div>
            <el-form :inline="true" :model="formInline" class="demo-form-inline">

                <el-form-item label="企业名称">
                    <el-select v-model="formInline.region" placeholder="请选择企业">
                        <el-option label="区域一" value="shanghai"></el-option>
                        <el-option label="区域二" value="beijing"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" icon="el-icon-search" size="mini" @click="onSubmit">查询</el-button>
                    <el-button icon="el-icon-refresh-right" size="mini" @click="onSubmit">重置</el-button>
                </el-form-item>
            </el-form>
        </div>
        <div>
            <el-button type="primary" icon="el-icon-plus" size="mini" @click="onSubmit">新增</el-button>
        </div>
        <DIV>
            <BR></BR>
        </DIV>
        <!-- 表格 -->
        <div>
            <el-table :data="tableData" border style="width: 100%">
                <el-table-column type="index" label="编号" width="80"> </el-table-column>
                <el-table-column prop="companyName" label="企业名称"> </el-table-column>
                <el-table-column prop="companySimpleName" label="企业简称"> </el-table-column>
                <el-table-column prop="number" label="人员数量"> </el-table-column>
                <el-table-column prop="color" label="标记颜色"> </el-table-column>
                <el-table-column prop="address" label="地理位置"> </el-table-column>
                <el-table-column fixed="right" label="操作" width="180">
                    <template slot-scope="scope">
                        <el-button @click="handleClick(scope)" type="text" size="small">查看</el-button>
                        <el-button @click="updateClick(scope)" type="text" size="small">编辑</el-button>
                        <el-button @click="delClick(scope)" type="text" size="small">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <!-- //分页 -->
        <div>
            <el-pagination 
            @size-change="handleSizeChange" 
            @current-change="handleCurrentChange"
            :current-page="currentPage4" 
            :page-sizes="[100, 200, 300, 400]" 
            :page-size="100"
            layout="total, sizes, prev, pager, next, jumper" :total="400">
            </el-pagination>
        </div>
    </div>
</template>

<script>
    // import {getCompanyList} from "@/api/infor/index.js"
export default {
    name: "InforIndex",
    data() {
        return {
            tableData: [{
                companyName: '内蒙古师范大学',
                companySimpleName: '内师大',
                number: '30000',
                color: '红色',
                address: '上海市普陀区金沙江路 1518 弄'
            }, {
                companyName: '内蒙古工业大学',
                companySimpleName: '内工大',
                number: '25000',
                color: '红色',
                address: '上海市普陀区金沙江路 1518 弄'
            }, {
                companyName: '内蒙古科技大学',
                companySimpleName: '内科大',
                number: '32000',
                color: '红色',
                address: '上海市普陀区金沙江路 1518 弄'
            }, {
                companyName: '内蒙古大学',
                companySimpleName: '内大',
                number: '35000',
                color: '红色',
                address: '上海市普陀区金沙江路 1518 弄'
            }],
            currentPage4: 4,

            formInline: {
                region: ''
            }
        }
    },
    created(){
    //请求发送
    // this.getList();
    },
    methods: {
        getList(){
    //请求列表方法
    // function(){}
    getCompanyList().then((res) => {
        console.log(res,'res');
        // data
    });
        },
        onSubmit() {
            console.log('submit!');
        },
        handleClick(scope) {
            console.log(scope);
            this.$router.push({
            path:"/infor/detail"
            });
        },
        updateClick(scope) {
            console.log(scope);
        },
        delClick(scope) {
            console.log(scope);
        },
        handleSizeChange(val) {
            console.log(`每页 ${val} 条`);
        },
        handleCurrentChange(val) {
            console.log(`当前页: ${val}`);
        },
    },

};


</script>

    
